#define _CRT_SECURE_NO_WARNINGS 
#include"Date&.h"

#include<stdio.h>
#include<stdlib.h>
typedef struct
{
    int y;
    int mo;
    int d;
}_data;
_data x1,x2;

int main()
{
    int i, j;
    int sum = 0;
    int k = 0;
    int day[12] = { 31,28,31,30,31,30,31,31,30,31,30,31 };
    scanf("%4d%2d%2d", &x1.y, &x1.mo, &x1.d);
    scanf("%4d%2d%2d", &x2.y, &x2.mo, &x2.d);
    if (x1.mo <= x2.mo)
    {
        for (i = x1.mo; i < x2.mo; i++)
            sum = sum + day[i - 1];
        sum = sum + abs(x1.d - x2.d);
    }
    else if (x1.mo > x2.mo)
    {
        for (i = x2.mo; i < x1.mo; i++)
            sum = sum - day[i - 1];
        sum = sum + abs(x1.d - x2.d);
    }
    for (i = x1.y; i < x2.y; i++)
    {
        if ((i % 4 == 0 && i % 100 != 0) || i % 400 == 0)
            k++;
    }
    sum = (x2.y - x1.y - k) * 365 + k * 366 + sum;
    printf("%d", sum + 1);
}